package com.novellotus.iov.carvice.presenter;

import android.support.v4.app.Fragment;

import com.novellotus.iov.carvice.contract.MainActivityContract;
import com.novellotus.iov.carvice.fragment.HomePagerFragment;
import com.novellotus.iov.carvice.fragment.MineFragment;
import com.novellotus.iov.carvice.fragment.NewsFragment;
import com.novellotus.iov.carvice.fragment.WorkFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Rich on 2017/12/22.
 */

public class MainActivityPresenter implements MainActivityContract.Presenter {

    MainActivityContract.View view;

    public MainActivityPresenter(MainActivityContract.View view) {
        this.view = view;

    }

    @Override
    public void getMainMessage() {
        List<Fragment> fragmentList = new ArrayList<>();
        fragmentList.add(new HomePagerFragment());
        fragmentList.add(new WorkFragment());
        fragmentList.add(new NewsFragment());
        fragmentList.add(new MineFragment());
        view.initLayout(fragmentList);
        view.initTabLayout();
    }

    @Override
    public void subscribe() {
    }

    @Override
    public void unsubscribe() {
    }
}
